media: Use safe GetDeviceApiLevel helper and API constants in media_codec - #11546
media: Use safe GetDeviceApiLevel helper and API constants in media_codec#11546borongc wants to merge 1 commit into
Conversation
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
There was a problem hiding this comment.
Code Review
This pull request refactors the retrieval of the Android device API level by introducing a centralized GetDeviceApiLevel() helper function and corresponding API level constants in media_common.h, replacing direct calls to android_get_device_api_level() in media_codec.cc. The review feedback suggests explicitly including "starboard/android/shared/media_common.h" in media_codec.cc to adhere to "Include What You Use" (IWYU) guidelines, and using the global namespace qualifier :: for the C system function android_get_device_api_level to prevent potential namespace lookup issues.
|
See #11544 (comment) for the review. |
|
Closed this PR as Cobalt's |
Replace direct calls to android_get_device_api_level() with a
centralized GetDeviceApiLevel() helper. This wrapper ensures
compatibility by handling potential null function pointers on older
Android versions. Additionally, replace hardcoded API level integers
with named constants to improve code maintainability and clarity.
This was caught in #11544.
Issue: 515461431